﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test.Utilities
{
    class OperatingSystem
    {
        static public string getOperatingSystemName()
        {
            string name = "";

            switch (Environment.OSVersion.Platform)
            {
                case PlatformID.Win32NT:
                    switch (Environment.OSVersion.Version.Major)
                    {
                        case 5:
                            switch (Environment.OSVersion.Version.Minor)
                            {
                                case 1:
                                    name = "Windows XP";
                                    break;
                            }
                            break;
                        case 6:
                            switch (Environment.OSVersion.Version.Minor)
                            {
                                case 0:
                                    name = "Windows Vista";
                                    break;
                                case 1:
                                    name = "Windows 2008";
                                    break;
                                case 2:
                                    name = "Windows 7";
                                    break;
                            }
                            break;
                    }
                    break;
            }

            return name;
        }
    }
}
